home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 2
/
Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso
/
Aminet
/
misc
/
amag
/
am9305d.lha
/
EGS.lha
/
EGS
/
EGS_Devels
/
doc
/
egslayers.doc
< prev
next >
Wrap
Text File
|
1993-03-18
|
23KB
|
1,084 lines
/*
* $
* $ FILE : egslayers.doc
* $ VERSION : 1
* $ REVISION : 1
* $ DATE : 08-Feb-93 09:56
* $
* $ Author : mvk
* $
*
*
* (c) Copyright 1990/93 VIONA Development
* All Rights Reserved
*
*/
egslayers.library/EL_AndRectRegion
egslayers.library/EL_AndRegionRegion
egslayers.library/EL_AndSmartClip
egslayers.library/EL_BeginUpdate
egslayers.library/EL_CreateBehindLayer
egslayers.library/EL_CreateLayerInfo
egslayers.library/EL_CreateUpfrontLayer
egslayers.library/EL_DeleteLayer
egslayers.library/EL_DelRectRegion
egslayers.library/EL_DelRegionRegion
egslayers.library/EL_DupMoveRegion
egslayers.library/EL_DupRegion
egslayers.library/EL_EndUpdate
egslayers.library/EL_FreeLayerInfo
egslayers.library/EL_FreeRect
egslayers.library/EL_FreeRegion
egslayers.library/EL_FreeSmartList
egslayers.library/EL_InstallLHook
egslayers.library/EL_InstallLIHook
egslayers.library/EL_Invalidate
egslayers.library/EL_LayerToBack
egslayers.library/EL_LayerToFront
egslayers.library/EL_LockLayer
egslayers.library/EL_LockLayerInfo
egslayers.library/EL_LockLayers
egslayers.library/EL_MoveLayer
egslayers.library/EL_MoveLayerBehind
egslayers.library/EL_MoveLayerInFront
egslayers.library/EL_MoveRegion
egslayers.library/EL_NewRect
egslayers.library/EL_OrRectRegion
egslayers.library/EL_OrRegionRegion
egslayers.library/EL_RemoveRefreshRegion
egslayers.library/EL_ScrollLayer
egslayers.library/EL_SizeLayer
egslayers.library/EL_UnlockLayer
egslayers.library/EL_UnlockLayerInfo
egslayers.library/EL_UnlockLayers
egslayers.library/EL_UpdateBackMap
egslayers.library/EL_UpdateFrontMap
egslayers.library/EL_WhichLayer
egslayers.library/EL_AndRectRegion
NAME
EL_AndRectRegion Ands a rectangle with a region
SYNOPSIS
rect = EL_AndRectRegion(oldList, new)
D0 A0 A1
EB_ClipRectPtr rect, oldList, new;
FUNCTION
Ands a rectanle with a region. The resulting region includes all areas,
that are in both source areas.
INPUTS
oldList : list of cliprects, describing an area, the list is disposed
during operation
new : one cliprect
RETURNS
the resulting area
egslayers.library/EL_AndRegionRegion
NAME
EL_AndRegionRegion Ands two regions
SYNOPSIS
rect = EL_AndRegionRegion(oldList, newList)
D0 A0 A1
EB_ClipRectPtr rect, oldList, newList;
FUNCTION
Ands a region with an other region. The resulting region includes all areas,
that are in both source areas.
INPUTS
oldList : list of cliprects, describing an area, the list is disposed
during operation
newList : list of cliprects, describing an area, the list is disposed
during operation
RETURNS
the resulting area
egslayers.library/EL_AndSmartClip
NAME
EL_AndSmartClip
SYNOPSIS
rect = EL_AndSmartClip(smart, clip)
D0 A0 A1
EL_SmartPtr rect, smart;
EB_ClipRectPtr clip;
FUNCTION
Internal use only
INPUTS
RETURNS
egslayers.library/EL_BeginUpdate
NAME
EL_BeginUpdate Attempts to start refresh
SYNOPSIS
success = EL_BeginUpdate(layer, key)
D0 A0 D0
BOOL success;
EL_LayerPtr layer;
ULONG key;
FUNCTION
Attempts to start an update of a simple- (or smart- in some cases) refresh
layer. The refresh key determines if this is the actual refresh. If not
the function returns 0.
During refresh the layer is locked, and the normal clipping area is replaced
by the damaged area, so that drawing only takes place in the damaged area.
The refresh may be done in several steps, using EL_BeginUpdate and
EL_EndUpdate. The refresh key solves a problem, that can occur using
splitted refresh:
- the user moves a window
- an hidden area of a layer becomes visible
- the library sends a refresh message
- the programm receives the refresh message
- the programm calls EL_BeginUpdate
- the programm refreshes first part of the layer
- the programm calls EL_EndUpdate(..FALSE)
- the user moves a window
- an hidden area of a layer becomes visible
- the library sends a refresh message
- the programm calls EL_BeginUpdate
- the programm refreshes second part of the layer, including
the second refresh area
- the programm calls EL_EndUpdate(..TRUE), the library frees then
refresh area
- the programm receives the second refresh message, and refreshes an
empty area
=> the second area is not refreshed by the first refresh routine
And now using a refresh key:
- the user moves a window
- an hidden area of a layer becomes visible
- the library increments refresh key to 1, sends a refresh message
- the programm receives the refresh message
- the programm calls EL_BeginUpdate(... 1)
- the programm refreshes first part of the layer
- the programm calls EL_EndUpdate(..FALSE)
- the user moves a window
- an hidden area of a layer becomes visible
- the library increments refresh key to 2, sends a refresh message
- the programm calls EL_BeginUpdate(... 1)
- calll fails, programm terminates refresh
- the programm receives the refresh message
- the programm calls EL_BeginUpdate(... 2)
- the programm refreshes first part of the layer
- the programm calls EL_EndUpdate(..FALSE)
- the programm calls EL_BeginUpdate(... 2)
- the programm refreshes first part of the layer
- the programm calls EL_EndUpdate(..TRUE)
=> both areas are refreshed by both routines
If not terminated by the library (at "BeginUpdate"), a refresh should be
carried out to the "EndUpdate(l,TRUE)" since only in this way the "damage"
Region is destroyed again. If the refresh chain is never ended with this
convention, the "damage" Region grows over the complete window, thus
losing its meaning.
INPUTS
layer : layer, which to refresh
key : refresh key, available in the refresh message
RETURNS
0 if attempt fails, then just forget about refresh
egslayers.library/EL_CreateBehindLayer
NAME
EL_CreateBehindLayer creates a layer behind all others
SYNOPSIS
layer = EL_CreateBehindLayer(info, x, y, width, height,
D0 A0 D0 D1 D2 D3
maxWidth, maxHeight, flags, color)
D4 D5 D6 D7
EL_LayerPtr layer;
EL_LayerInfoPtr info;
WORD x, y, width, height, maxWidth, maxHeight;
ULONG flags;
ULONG color;
FUNCTION
Creates a layer behind all other layers on a bitmap. If it fails returns
NULL. The layer need not be on the bitmap. If the type is superbitmap,
also allocates the needed bitmap.
INPUTS
info : layer info structure of the bitmap
x, y : upper left edge of the layer
width, height : dimensions of the layer
maxWidth,
maxHeight : maximum dimensions of the layer, used to allocate
background bitmap for superbitmap layers
flags : flags from LayerFlagSet
color : layers background color
RETURNS
an initialized layer, or NULL if the fucntion fails
egslayers.library/EL_CreateLayerInfo
NAME
EL_CreateLayerInfo creates layer info structure for a bitmap
SYNOPSIS
linfo = EL_CreateLayerInfo(map, port, width, height, color, pattern)
D0 A0 A1 D0 D1 D2 A2
EL_LayerInfoPtr linfo;
E_EBitMapPtr map;
struct MsgPort * port;
WORD width, height;
ULONG color;
E_EBitMapPtr pattern;
FUNCTION
Creates a layer info structure for a bitmap. This structure is needed
to use layers on this bitmap (or screen).
The structure is completely initialized and can be used to create layers
immediately.
INPUTS
map : bitmap for the layer
port : message port for refresh messages
width, height : layer info dimensions
color : backgroundcolor
pattern : pointer to an image to use as backimage, NULL to use the
backgroundcolor
RETURNS
an initialized layerinfo, or NULL if the fucntion fails
egslayers.library/EL_CreateUpfrontLayer
NAME
EL_CreateUpfrontLayer create a layer in front of all others
SYNOPSIS
layer = EL_CreateUpfrontLayer(info, x, y, width, height,
D0 A0 D0 D1 D2 D3
maxWidth, maxHeight, flags, color)
D4 D5 D6 D7
EL_LayerPtr layer;
EL_LayerInfoPtr info;
WORD x, y, width, height, maxWidth, maxHeight;
ULONG flags;
ULONG color;
FUNCTION
Creates a layer in front of all other layers on a bitmap. If it fails returns
NULL. The layer need not be on the bitmap. If the type is superbitmap,
also allocates the needed bitmap.
INPUTS
info : layer info structure of the bitmap
x, y : upper left edge of the layer
width, height : dimensions of the layer
maxWidth,
maxHeight : maximum dimensions of the layer, used to allocate
background bitmap for superbitmap layers
flags : flags from LayerFlagSet
color : layers background color
RETURNS
an initialized layer, or NULL if the fucntion fails
egslayers.library/EL_DeleteLayer
NAME
EL_DeleteLayer delete a layer
SYNOPSIS
EL_DeleteLayer(layer)
A0
EL_LayerPtr layer;
FUNCTION
Deletes a layer which has been created with EL_CreateUpfrontLayer or
EL_CreateBehindLayer
INPUTS
RETURNS
egslayers.library/EL_DelRectRegion
NAME
EL_DelRectRegion removes a rectangle out of a region
SYNOPSIS
rect = EL_DelRectRegion(oldList, new)
D0 A0 A1
EB_ClipRectPtr rect, oldList, new;
FUNCTION
Removes a rectangle out of a region. Returns a region, that conatins all
areas that are in oldList, but not in new.
INPUTS
oldList : list of cliprects, describing an area, the list is disposed
during operation
new : cliprect describing a rectangle
RETURNS
the resulting region
egslayers.library/EL_DelRegionRegion
NAME
EL_DelRegionRegion removes a region out of an other
SYNOPSIS
rect = EL_DelRegionRegion(oldList, newList)
D0 A0 A1
EB_ClipRectPtr rect, oldList, new;
FUNCTION
Removes a region out of an other. Returns a region containing all areas
that where included in oldList but not in newList.
INPUTS
oldList : list of cliprects, describing an area, the list is disposed
during operation
newList : list of cliprects, describing an area, the list is disposed
during operation
RETURNS
the resulting region
egslayers.library/EL_DupMoveRegion
NAME
EL_DupMoveRegion duplicate and move region
SYNOPSIS
rect = EL_DupMoveRegion(list, dx, dy)
D0 A0 D1 D2
EB_ClipRectPtr rect, list;
WORD dx, dy;
FUNCTION
Duplicates a region, and moves the new region by dx, dy (only the structures
are modified, nothing is really moved).
INPUTS
list : list of cliprects, describing an area
RETURNS
a copy of list, which is moved by dx, dy
egslayers.library/EL_DupRegion
NAME
EL_DupRegion duplicates a region
SYNOPSIS
rect = EL_DupRegion(old)
D0 A0
EB_ClipRectPtr rect, old;
FUNCTION
Duplicates a region, by duplicating all cliprects. The original region is
not touched.
INPUTS
RETURNS
a deep copy of old
egslayers.library/EL_EndUpdate
NAME
EL_EndUpdate
SYNOPSIS
EL_EndUpdate(layer, done)
A0 D0
EL_LayerPtr layer;
BOOL done;
FUNCTION
Ends a phase of refreshing a layer. If done is 0 then the damaged area
is preserved, so the refresh can be continued else, the area is disposed.
INPUTS
RETURNS
egslayers.library/EL_FreeLayerInfo
NAME
EL_FreeLayerInfo destructs a layer info
SYNOPSIS
EL_FreeLayerInfo(info)
A0
EL_LayerInfo info;
FUNCTION
Frees a layer info structure and all associated structures. Also frees all
open layers on that bitmap
INPUTS
RETURNS
egslayers.library/EL_FreeRect
NAME
EL_FreeRect
SYNOPSIS
EL_FreeRect(rect)
A0
EB_ClipRectPtr rect;
FUNCTION
Moves a cliprect back to the free pool. The cliprects are cached, so you may
not access the cliprect after this operation.
INPUTS
RETURNS
egslayers.library/EL_FreeRegion
NAME
EL_FreeRegion
SYNOPSIS
EL_FreeRegion(old)
A0
EB_ClipRectPtr old;
FUNCTION
Moves a list of cliprects back to the free pool. The cliprects are cached, so
you may not access the region after this operation.
INPUTS
RETURNS
egslayers.library/EL_FreeSmartList
NAME
EL_FreeSmartList
SYNOPSIS
EL_FreeSmartList(smart)
A0
EL_SmartPtr smart;
FUNCTION
Internal use
INPUTS
RETURNS
egslayers.library/EL_InstallLHook
NAME
EL_InstallLHook install a layer backfill hook
SYNOPSIS
EL_InstallLHook(layer,hook)
A0 A1
EL_LayerPtr layer;
EL_BackFillHook hook;
FUNCTION
Installs a back fill hook in a layer. The layer background is filled
immediately with this function. If NULL is passed as hook, then the original
back color is used again.
INPUTS
RETURNS
egslayers.library/EL_InstallLIHook
NAME
EL_InstallLIHook install a layer info backfill hook
SYNOPSIS
EL_InstallLIHook(info,hook)
A0 A1
EL_LayerInfoPtr info;
EL_BackFillHook hook;
FUNCTION
Installs a back fill hook in a layer info. The screen background is filled
immediately with this function. If NULL is passed as hook, then the original
screen back color or pattern is used again.
INPUTS
RETURNS
egslayers.library/EL_Invalidate
NAME
EL_Invalidate invalidate a region in a layer
SYNOPSIS
EL_Invalidate(layer,region)
A0 A1
EB_ClipRectPtr region
FUNCTION
Invalidates a region in a layer. The region is added to the invalid list and
a message is send, if requiered. This function can be used to force a redraw
of an area of a layer/window. It is for example used by EG_ScrollRastPort.
INPUTS
region a list of clip rects. It is not freed after usage, so the caller
has to take care of it himself.
RETURNS
egslayers.library/EL_LayerToBack
NAME
EL_LayerToBack moves a layer to back
SYNOPSIS
EL_LayerToBack(layer)
A0
EL_LayerPtr layer;
FUNCTION
Moves a layer behind all other layers on this bitmap
INPUTS
RETURNS
egslayers.library/EL_LayerToFront
NAME
EL_LayerToFront moves a layer to front
SYNOPSIS
EL_LayerToFront(layer)
A0
EL_LayerPtr layer;
FUNCTION
Moves a layer in front of all other layers on this bitmap
INPUTS
RETURNS
egslayers.library/EL_LockLayer
NAME
EL_LockLayer lock a layer
SYNOPSIS
EL_LockLayer(layer)
A0
EL_LayerPtr layer;
FUNCTION
Locks a layer for private access of a task. This has to be done, before the
cliplists of the layer are accessed. You should have not locked any
other layer yet, to avoid deadlocks. If you want to lock more layers
than one, you should enclose this by EL_LockLayerInfo...EL_UnlockLayerInfo.
The layer has to be released by EL_UnlockLayer to keep the system alive.
If the layer is allready occupied by an other task, this function will
wait for release.
"egslayers.library", "egsgfx.library" and "egsintui.library" respect this
convention so that a layer need not be locked explicitly when calling
functions from these libraries.
INPUTS
RETURNS
egslayers.library/EL_LockLayerInfo
NAME
EL_LockLayerInfo lock layer info structure
SYNOPSIS
EL_LockLayerInfo(info)
A0
EL_LayerInfoPtr info;
FUNCTION
Locks a layer info structure for private access of one task. This call
has to be paired by an EL_UnlockLayerInfo.
If the layerinfo is allready occupied by an other task, this function will
wait for release.
INPUTS
RETURNS
egslayers.library/EL_LockLayers
NAME
EL_LockLayers lock all layers of a bitmap
SYNOPSIS
EL_LockLayers(info)
A0
EL_LayerInfoPtr info;
FUNCTION
Locks all layers of a bitmap for private access by one task. This call
has to be paired by EL_UnlockLayers. This function will first lock
the layerinfo structure then locking all layers.
If a layer is allready occupied by an other task, this function will
wait for release.
All layer functions do a EL_LockLayers...EL_UnlockLayers during execution.
INPUTS
RETURNS
egslayers.library/EL_MoveLayer
NAME
EL_MoveLayer move a layer
SYNOPSIS
EL_MoveLayer(layer, dx, dy)
A0 D0 D1
EL_LayerPtr layer;
WORD dx, dy;
FUNCTION
Moves a layer by a specified amount. The layer may be moved outside the
bitmap.
INPUTS
RETURNS
egslayers.library/EL_MoveLayerBehind
NAME
EL_MoveLayerBehind move layer behind an other
SYNOPSIS
EL_MoveLayerBehind(layer, behind)
A0 A1
EL_LayerPtr layer, behind;
FUNCTION
Moves a layer behind an other layer on the same bitmap.
INPUTS
layer : layer which to move
behind : layer that will be in front of the other after operation
RETURNS
egslayers.library/EL_MoveLayerInFront
NAME
EL_MoveLayerInFront move layer before an other
SYNOPSIS
EL_MoveLayerInFront(layer, front)
A0 A1
EL_LayerPtr layer, front;
FUNCTION
Moves a layer before an other layer on the same bitmap.
INPUTS
layer : layer which to move
front : layer that will be behind the other after operation
RETURNS
egslayers.library/EL_MoveRegion
NAME
EL_MoveRegion move a region
SYNOPSIS
rect = EL_MoveRegion(list, dx, dy)
D0 A0 D1 D2
EB_ClipRectPtr rect, list;
WORD dx, dy;
FUNCTION
Moves a region by dx, dy. This function only modifies the cliprect list,
it does not really move something.
INPUTS
list : list of cliprects, describing an area, the list is disposed
during operation
RETURNS
a moved list
egslayers.library/EL_NewRect
NAME
EL_NewRect create new cliprect
SYNOPSIS
rect = EL_NewRect()
D0
EB_ClipRectPtr rect;
FUNCTION
Creates a cliprect by taking from the free pool.
As ClipRects used by the egslayers.library are bigger than those defined in
the egsblit.library, ClipRects used for Regions should be created by this
function (or by DupRegion).
INPUTS
RETURNS
a pointer to a cliprect structure
egslayers.library/EL_OrRectRegion
NAME
EL_OrRectRegion adds a rectangle to a region
SYNOPSIS
rect = EL_OrRectRegion(oldList, new)
D0 A0 A1
EB_ClipRectPtr rect, oldList, new;
FUNCTION
Adds a rectangle to a region. The result is a region that contains all areas
which had been in one ore both source regions.
INPUTS
oldlist : list of cliprects, describing an area, the list is disposed
during operation
new : one cliprect
RETURNS
the resulting region
egslayers.library/EL_OrRegionRegion
NAME
EL_OrRegionRegion adds a region to an other
SYNOPSIS
rect = EL_OrRegionRegion(oldList, newList)
D0 A0 A1
EB_ClipRectPtr rect, oldList, newList;
FUNCTION
Adds a region to an other. The result is a region that contains all areas
which had been in one ore both source regions.
INPUTS
oldlist : list of cliprects, describing an area, the list is disposed
during operation
newlist : list of cliprects, describing an area, the list is disposed
during operation
RETURNS
the resulting region
egslayers.library/EL_RemoveRefreshRegion (EL_LayerPtr layer, EB_ClipRectPtr region);
NAME
EL_RemoveRefreshRegion remove part of the refresh area
SYNOPSIS
EL_RemoveRefreshRegion (layer, region);
A0 A1
EL_LayerPtr layer;
EB_ClipRectPtr region;
FUNCTION
Removes the supplied region from the refresh region. This function
is used if the user scrolls a layer and thus damages the newly
exposed area but refreshes this right away. This function
is then used to tell layers that the area will be refreshed.
This will change the RefreshKey in the layer, so the refresh message
doesn't cause a refresh.
INPUTS
layer : affected layer
region : area that the application is going to refresh now,
in layer relative coordinates (i.e. window-relative)
RETURNS
none
egslayers.library/EL_ScrollLayer
NAME
EL_ScrollLayer scroll the contents of a layer
SYNOPSIS
EL_ScrollLayer(layer, dx, dy)
A0 D0 D1
EL_LayerPtr layer;
WORD dx, dy;
FUNCTION
Scrolls the interior of a layer by dx, dy. This function will cause a refresh
in smart- and simplerefresh layers. This has to be used if the visible part
of a superbitmap layer has to be moved.
INPUTS
layer : affected layer
dx : number of pixels to scroll horizontally
dy : number of pixels to scroll vertically
RETURNS
none
egslayers.library/EL_SizeLayer
NAME
EL_SizeLayer modify size of a layer
SYNOPSIS
EL_SizeLayer(layer, dx, dy)
A0 D0 D1
EL_LayerPtr layer;
WORD dx, dy;
FUNCTION
Modifies the visible size of a layer by dx, dy. This function will cause
a refresh in smart- and simplerefresh layers. You should not resize a layer
that much that its visble area exceeds the maximum given in
EL_Create...Layer.
INPUTS
RETURNS
egslayers.library/EL_UnlockLayer
NAME
EL_UnlockLayer unlock a layer
SYNOPSIS
EL_UnlockLayer(layer)
A0
EL_LayerPtr layer;
FUNCTION
Unlocks a layer, pair to EL_LockLayer.
INPUTS
RETURNS
egslayers.library/EL_UnlockLayerInfo
NAME
EL_UnlockLayerInfo unlock layer info structure
SYNOPSIS
EL_UnlockLayerInfo(info)
A0
EL_LayerInfoPtr info;
FUNCTION
Unlocks a layer info structure, pair to EL_LockLayerInfo.
INPUTS
RETURNS
egslayers.library/EL_UnlockLayers
NAME
EL_UnlockLayers
SYNOPSIS
EL_UnlockLayers(info)
A0
EL_LayerInfoPtr info;
FUNCTION
Unlocks all layers of a layer info structure, pair to EL_LockLayers.
INPUTS
RETURNS
egslayers.library/EL_UpdateBackMap
NAME
EL_UpdateBackMap updates the back map of a superbitmap layer
SYNOPSIS
EL_UpdateBackMap(layer)
A0
EL_LayerPtr layer;
FUNCTION
Updates the backmap of a superbitmap window, by copying the visible part
into the backmap. This is handy to have all information in one bitmap,
in order to save an image etc. You should lock the layer, to make sure it
is not altered, while using the backmap. If you modify the backmap you
should call EL_UpdateFrontMap, to modify the visible part too.
INPUTS
RETURNS
egslayers.library/EL_UpdateFrontMap
NAME
EL_UpdateFrontMap update visible part of a superbitmap layer
SYNOPSIS
EL_UpdateFrontMap(layer)
A0
EL_LayerPtr layer;
FUNCTION
Updates the visible part of a superbitmap layer by copying the visible
parts from the backmap to screen. If you want to render in the backmap,
and then update the front map, you should surround the rendering by a
EL_LockLayer...EL_UnlockLayer pair, to make sure, that no parts of the
visible area are copied to the backmap caused by user actions.
INPUTS
RETURNS
egslayers.library/EL_WhichLayer
NAME
EL_WhichLayer Which layer is a point in ?
SYNOPSIS
layer = EL_WhichLayer(info, x, y)
D0 A0 D0 D1
EL_LayerPtr layer;
EL_LayerInfoPtr info;
WORD x, y;
FUNCTION
Returns the topmost layer that conatins the given point. If no layer
contains it returns NULL.
INPUTS
RETURNS